import request from "@/utils/request";

// 获取试卷列表
export const getPaperListApi = (params) => {
    return request({
        url: "/admin/exam/paper",
        params
    })
}
// 获取归属学科
export const getSubjectListApi = () => {
    return request({
        url: "/admin/subject/tree",
    })
}
// 改变试卷状态
export const changePaperStateApi = (id, state) => {
    return request({
        url: `/admin/exam/paper/${id}/${state}`,
    })
}

// 删除试卷
export const delPaperApi = (id) => {
    return request({
        url: "/admin/exam/paper/" + id,
        method: "DELETE"
    })
}
// 选择试题查询
export const chooseQuestionApi = params => {
    return request({
        url: '/admin/exam/question',
        params
    })
}

// 新增试卷
export const addPaperApi = data => {
    return request({
        url: '/admin/exam/paper',
        method: 'POST',
        data
    })
}